import requests
import time
import hashlib

m = hashlib.md5()

content = 'test'
current_milli_time = lambda: int(round(time.time() * 1000))
timestamp = current_milli_time() / 1000

params = {
    "chatid": "chat83aa81a58e6d4f68dfbaf859f9e43d03",
    "sender": "724",
    "msgtype": "text",
    "text": {
        "content": "test 请忽略"
    }
}
m.update("255f61c99e77495a" + "bc16729c4150ed3589e6679a627c301c" + str(timestamp))
signature = m.hexdigest()
header = {
    "appId": "255f61c99e77495a",
    "signature": signature,
    "timestamp": str(timestamp),
    "Content-Type": "application/json"
}
req = requests.post(
    '{0}/chat/send'.format('http://ddcorp.dc.fdd:6015'), json=params, headers=header)
print req.content
